Use case: DMA channel peripheral transfer in circular mode ¶
Sequence diagram ¶
Note
The DMA start and stop procedures must be adjusted according to the selected peripheral (PPP).
Code snippet ¶
The following code snippet is an example of I2C DMA transfer in circular mode.
|
HAL1 |
HAL2 |
|---|---|
HAL_DMA_Init(&handle_GPDMA1_Channe0);
HAL_DMAEx_List_Init(&handle_GPDMA1_Channe0);
|
HAL_DMA_Init(&hdma1, GPDMA1_CH0);
HAL_DMA_SetConfigPeriphLinkedListCircularXfer(&hdma1, &DMA_Node_I2C1_TX, &xfer_cfg_i2c1_tx_dma);
|
Key changes ¶
HAL2 configures circular peripheral transfers using
HAL_DMA_SetConfigPeriphLinkedListCircularXfer().HAL2 starts the peripheral transfer using
HAL_DMA_StartPeriphXfer_IT_Opt().Abort and IRQ handling remain based on
HAL_DMA_Abort_IT()andHAL_DMA_IRQHandler().

